import { ApiProperty } from "@nestjs/swagger";
import { ArrayNotEmpty, IsArray, IsNotEmpty, IsNumber, IsString } from "class-validator";

export class RoleAddMenuDto {
    @ApiProperty({ description: "菜单id数组", example: [1, 2, 3] })
    @IsArray({ message: "确保属性是一个数组" })//确保属性是一个数组
    @ArrayNotEmpty({ message: "确保数组不为空" })//确保数组不为空
    @IsNumber({}, { each: true, message: "确保数组中的每个元素都是数字" })
    menuIds: number[];
    
    @ApiProperty({ description: "角色id", example: 1 })
    @IsNumber()
    roleId: number;
}